class TreeNode {
    constructor(value) {
        this.value = value;
        this.left = null;
        this.right = null;
    }
}


const inorderTraversal = (node) => {
    if (node === null) return;
    
    inorderTraversal(node.left); // 递归遍历左子树
    console.log(node.value); // 访问当前节点
    inorderTraversal(node.right); // 递归遍历右子树

}


let root = new TreeNode(1);
root.left = new TreeNode(2);
root.right = new TreeNode(3);
root.left.left = new TreeNode(4);
root.left.right = new TreeNode(5);

inorderTraversal(root)